<template>
	<view class="loginflash">
		<image :src="flashimg" class="flashimg"></image>
	</view>
</template>

<script>
	import ajax from "../../api/apis.js"
	export default {
		data() {
			return {
				flashimg: require("../../static/image/launcher_img.png")
			}
		},
		mounted() {
			let userid = uni.getStorageSync("userid")
			let user = uni.getStorageSync("user")
			console.log(user)

			let timer = setInterval(function() {
					if (user) {
						uni.switchTab({
							url: "../monitor/monitor",
							success() {
								clearInterval(timer)
							}
						})
					} else {
						uni.navigateTo({
							url: "../login/login",
							success() {
								clearInterval(timer)
							}
						})
					}
				},
				3000);
		}
	}
</script>
<style scoped>
	uni-page-body {
		height: 100%;
	}

	.loginflash {
		height: 100%;
		width: 100%;
	}

	.flashimg {
		height: 100%;
		width: 100%;
	}
</style>
